//
//  ThirdViewController.m
//  Objc进阶Demo
//
//  Created by Don't update on 2018/7/17.
//  Copyright © 2018年 Don't update. All rights reserved.
//

#import "ThirdViewController.h"
#import "JumpView.h"
@interface ThirdViewController ()
@property(nonatomic,strong)JumpView *jumpView;
@property(nonatomic,strong)UIButton *btn;
@end

@implementation ThirdViewController


-(UIButton *)btn{
    if (_btn == nil) {
        _btn = [[UIButton alloc]initWithFrame:CGRectMake(20, 200, 50, 50)];
        _btn.backgroundColor = [UIColor redColor];
        [_btn addTarget:self action:@selector(btnAnimation) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:_btn];
    }
    return _btn;
}



-(void)btnAnimation{
    [UIView animateWithDuration:1  animations:^{
        _btn.frame = CGRectMake(100, 400, 50, 50);
    }];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"视图跳转";
    [self btn];
    _jumpView = [[JumpView alloc]initWithFrame:CGRectMake(20, 100, 50, 50)];
    [self.view addSubview:_jumpView];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
